package com.hc.session.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

/**
 * @Author: huangcheng
 * @CreateTime: 2023-09-15  11:08
 * @Description:
 * @Version: 1.0
 */
@RestController
public class SpringSessionController {
    @GetMapping("/session")
    public String session(HttpServletRequest request) {
        return "session: " + request.getSession().getId() + "  port: " + request.getServerPort();
    }
}
